"""author: wenyao
   data: 2021/5/8
   project: devopscmdb
"""
# a = "abc"
# print(dir(a))

#构造方法
#__new__ 创建实例
#__init__ 实例进行初始化

#析构函数(__del__)
#实例销毁或释放的时候自动执行

#调用方法 __call__
#把实例化之后的对象当做函数来自动调用
# class ATM:
#     def __del__(self):
#         print("执行del")
#
#     def __call__(self, name, age):
#         print(f"my name is {name}, my age is {age}")
#
# a = ATM()
# a("sc",4)

#__str__  __repr__
#对象实例的描述信息
#__str__  默认调用的就是__repr__
#__str__  给用户看的
#__repr__  给程序员看的
# >>> class A:                                                                              [1/32]
# ...     def __str__(self):
# ...         return "str....A"
# ...     def __repr__(self):
# ...         return "repr....A"
# ...
# >>> A
# <class '__main__.A'>
# >>> print(A)
# <class '__main__.A'>
# >>> a = A()
# >>> print(a)
# str....A
# >>> a
# repr....A

# __getitem__
# __setitem__
# __delitem__
#以字典的形式去设置或者获取参数
# class A:
#     def __init__(self):
#         self.data = {}
#
#     def __getitem__(self,key):
#         print("get data:")
#         return  self.data.get(key,0)
#
#     def __setitem__(self, key, value):
#         print("set data:", key, value)
#         self.data[key] = value
#
#     def __delitem__(self, key):
#         print("delete data")
#         del(self.data[key])
#
# a = A()
# a["key"] = "value"
# print(a.data)
# print(a["key"])
# a["k1"] = "v1"
# a["k2"] = "v2"
# print(a.data)
# del a["key"]


# class A:
#     def __init__(self,num):
#         self.num = num
#
#     def __add__(self, x):
#         print("this is add")
#         return self.num +x
#
# a = A(1)
# B = a + 2
# print(B)


class LenError(Exception):
    def __str__(self):
        return "len error"

num = input("请输入：")
try:
    if 6 > len(num) or 10 < len(num):
        raise LenError
except LenError as er:
    print(er)
else:
    print(num)
